import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
  routes: [
    // {
    //   path: '*',
    //   redirect: '/'
    // },
    {
      path: '/',
      name: 'home',
      component: Home,
      redirect: '/order',
      children: [{
        name: 'order',
        path: 'order',
        component: resolve => require(['./views/Home/Order.vue'], resolve)    //首页客户订单
      },
      {
        path: 'mine',
        name: 'mine',
        component: resolve => require(['./views/Mine/Mine.vue'], resolve)     //首页我的
      },
      {
        path: 'stock',
        name: 'stock',
        component: resolve => require(['./views/Stock/Stock.vue'], resolve)   //首页进货
      },
      {
        path: 'productSetting',
        name: 'productSetting',
        component: resolve => require(['./views/Product/ProductSetting.vue'], resolve)    //首页商品设置
      }]
    },
    {
      path: '/register',
      name: 'register',
      component: resolve => require(['./views/Register.vue'], resolve)             //注册
    },
    {
      path: '/checking',
      name: 'checking',
      component: resolve => require(['./views/Checking.vue'], resolve)             //审核
    },
    {
      path: '/stockConfirm',
      name: 'stockConfirm',
      component: resolve => require(['./views/Stock/StockConfirm.vue'], resolve)    //进货确认订单
    },
    {
      path: '/stockPay',
      name: 'stockPay',
      component: resolve => require(['./views/Stock/StockPay.vue'], resolve)        //进货支付
    },
    {
      path: '/stockPaySuccess',
      name: 'stockPaySuccess',
      component: resolve => require(['./views/Stock/StockPaySuccess.vue'], resolve)   //进货支付成功（线上）
    },
    {
      path: '/stockPaySuccessOffline',
      name: 'stockPaySuccessOffline',
      component: resolve => require(['./views/Stock/StockPaySuccessOffline.vue'], resolve)//进货支付成功（线下）
    },
    {
      path: '/stockOrder',
      name: 'stockOrder',
      component: resolve => require(['./views/Stock/StockOrder.vue'], resolve)  //进货订单
    },
    {
      path: '/stockOrderDetail',
      name: 'stockOrderDetail',
      component: resolve => require(['./views/Stock/StockOrderDetail.vue'], resolve)  //进货订单详情
    },
    {
      path: '/waterMoneyManagement',
      name: 'waterMoneyManagement',
      component: resolve => require(['./views/Mine/WaterMoneyManagement.vue'], resolve) //水费管理
    },
    {
      path: '/waterMoneyManagementDetail',
      name: 'waterMoneyManagementDetail',
      component: resolve => require(['./views/Mine/WaterMoneyManagementDetail.vue'], resolve) 
    },
    {
      path: '/productEdit',
      name: 'productEdit',
      component: resolve => require(['./views/Product/ProductEdit.vue'], resolve) //商品编辑
    },
    {
      path: '/palouEdit',
      name: 'palouEdit',
      component: resolve => require(['./views/Product/PalouEdit.vue'], resolve) //爬楼编辑
    },
    {
      path: '/palouAdd',
      name: 'palouAdd',
      component: resolve => require(['./views/Product/PalouAdd.vue'], resolve) //爬楼新增
    },
    {
      path: '/productAdd',
      name: 'productAdd',
      component: resolve => require(['./views/Product/ProductAdd.vue'], resolve)  //商品新增
    },
    {
      path: '/stationEdit',
      name: 'stationEdit',
      component: resolve => require(['./views/Station/StationEdit.vue'], resolve) //配送站编辑
    },
    {
      path: '/edit',
      name: 'edit',
      component: resolve => require(['./views/Edit.vue'], resolve) //配送站重新编辑
    },
    {
      path: '/senderSetting',
      name: 'senderSetting',
      component: resolve => require(['./views/Mine/SenderSetting.vue'], resolve)  //配送员设置
    },
    {
      path: '/qrSetting',
      name: 'qrSetting',
      component: resolve => require(['./views/Mine/qrSetting.vue'], resolve)  //二维码
    },
    {
      path: '/customerManagement',
      name: 'customerManagement',
      component: resolve => require(['./views/Mine/CustomerManagement.vue'], resolve) //客户管理
    },
    {
      path: '/singleCustomerOrderList',
      name: 'singleCustomerOrderList',
      component: resolve => require(['./components/SingleCustomerOrderList.vue'], resolve) //客户管理
    },
    {
      path: '/bucketManagement',
      name: 'bucketManagement',
      component: resolve => require(['./views/Mine/BucketManagement.vue'], resolve) //水桶管理
    },
    {
      path: '/bucketManagementDetail',
      name: 'bucketManagementDetail',
      component: resolve => require(['./views/Mine/BucketManagementDetail.vue'], resolve) //水桶管理详情
    },
    {
      path: '/financeManagement',
      name: 'financeManagement',
      component: resolve => require(['./views/Mine/FinanceManagement.vue'], resolve) //财务管理
    },
    {
      path: '/dealInfo',
      name: 'dealInfo',
      component: resolve => require(['./views/Finance/DealInfo.vue'], resolve) //财务管理
    },
    {
      path: '/senderCountChart',
      name: 'senderCountChart',
      component: resolve => require(['./views/Finance/SenderCountChart.vue'], resolve) //配送员统计
    },
    {
      path: '/productTypeCountChart',
      name: 'productTypeCountChart',
      component: resolve => require(['./views/Finance/ProductTypeCountChart.vue'], resolve) //商品分类统计
    },
    {
      path: '/customerCountChart',
      name: 'customerCountChart',
      component: resolve => require(['./views/Finance/CustomerCountChart.vue'], resolve) //客户排行统计
    },
    {
      path: '/productSellCountChart',
      name: 'productSellCountChart',
      component: resolve => require(['./views/Finance/ProductSellCountChart.vue'], resolve) //商品销量统计
    },
    {
      path: '/financeReport',
      name: 'financeReport',
      component: resolve => require(['./views/Finance/FinanceReport.vue'], resolve) //总报表
    },
    {
      path: '/orderDetail',
      name: 'orderDetail',
      component: resolve => require(['./views/Home/OrderDetail.vue'], resolve)  //客户订单详情
    },
    {
      path: '/productApproval',
      name: 'productApproval',
      component: resolve => require(['./views/Product/ProductApproval.vue'], resolve)  //商品审核
    },
    {
      path: '/billInfo',
      name: 'billInfo',
      component: resolve => require(['./views/Mine/BillInfo.vue'], resolve)  //商品审核
    }
  ]
})
